package cn.com.dcsgo.service;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * 调用StudentService的其他Service类
 *
 * @author Dcsgo
 * @since 2025/2/7 16:02
 */
@Service
public class TopService {
    private final StudentService studentService;

    public TopService(StudentService studentService) {
        this.studentService = studentService;
    }

    @Transactional(rollbackFor = Throwable.class)
    public void changeStudent() {
        studentService.changeAge();
        studentService.changeName();
    }
}
